﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TailRecursive
{
	/// <summary>
	/// 单链表节点类
	/// </summary>
	public class Node
	{
		/// <summary>
		/// 构造函数
		/// </summary>
		/// <param name="value"></param>
		/// <param name="next"></param>
		public Node(int value, Node next)
		{
			this.Value = value;
			this.Next = next;
		}

		/// <summary>
		/// 值
		/// </summary>
		public int Value { get; set; }

		/// <summary>
		/// 节点类
		/// </summary>
		public Node Next { get; set; }

	}

	/// <summary>
	/// 二叉树节点类
	/// </summary>
	public class TreeNode
	{
		public TreeNode(int value, TreeNode left, TreeNode right)
		{
			this.Value = value;
			this.Left = left;
			this.Right = right;
		}

		/// <summary>
		/// 值
		/// </summary>
		public int Value { get; private set; }

		/// <summary>
		/// 左子树
		/// </summary>
		public TreeNode Left { get; private set; }

		/// <summary>
		/// 右子树
		/// </summary>
		public TreeNode Right { get; private set; }
	}

}
